<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>乐购用户优惠券管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnExport").click(function () {
                top.$.jBox.confirm("确认要导出用户优惠券数据吗？", "系统提示", function (v, h, f) {
                    if (v == "ok") {
                        $("#searchForm").attr("action", "${ctx}/shop/shop/hkUserCoupon/export");
                        $("#searchForm").submit();
                    }
                }, {buttonsFocus: 1});
                top.$('.jbox-body .jbox-icon').css('top', '55px');
            });
            $("#btnImport").click(function () {
                $.jBox($("#importBox").html(), {
                    title: "导入数据", buttons: {"关闭": true},
                    bottomText: "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
                });
            });
        });

        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/shop/shop/hkUserCoupon/">乐购用户优惠券列表</a></li>
    <shiro:hasPermission name="shop:shop:hkUserCoupon:edit">
        <li><a href="${ctx}/shop/shop/hkUserCoupon/form">乐购用户优惠券添加</a></li>
    </shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="hkUserCoupon" action="${ctx}/shop/shop/hkUserCoupon/" method="post"
           class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <ul class="ul-form">
        <li><label>名称：</label>
            <form:input path="title" htmlEscape="false" maxlength="200" class="input-medium"/>
        </li>
        <li><label>状态：</label>
            <form:select path="state" class="input-medium">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('user_coupon_state')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </li>
        <li class="btns">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
            <input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
        </li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>名称</th>
        <th>券标题</th>
        <th>商品名称</th>
        <th>用户名称</th>
        <th>联系方式</th>
        <th>购买时间</th>
        <th>使用时间</th>
        <th>状态</th>
        <shiro:hasPermission name="shop:shop:hkUserCoupon:edit">
            <th>操作</th>
        </shiro:hasPermission>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="hkUserCoupon">
        <tr>
            <td>
                    <%--<a href="${ctx}/shop/shop/hkUserCoupon/form?id=${hkUserCoupon.id}">--%>
                    ${hkUserCoupon.title}
                    <%--</a>--%>
            </td>

            <td>
                    ${hkUserCoupon.coupon.title}
            </td>
            <td>
                    ${hkUserCoupon.product.title}
            </td>
            <td>
                    ${hkUserCoupon.user.name}
            </td>
            <td>
                    ${hkUserCoupon.user.mobile}
            </td>
            <td>
                <fmt:formatDate value="${hkUserCoupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <fmt:formatDate value="${hkUserCoupon.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                    <%--${hkUserCoupon.state}--%>
                            ${fns:getDictLabel(hkUserCoupon.state, 'user_coupon_state', '')}
            </td>
            <%--<shiro:hasPermission name="shop:shop:hkUserCoupon:edit">
                <td>
                    <a href="${ctx}/shop/shop/hkUserCoupon/form?id=${hkUserCoupon.id}">修改</a>
                    <a href="${ctx}/shop/shop/hkUserCoupon/delete?id=${hkUserCoupon.id}"
                       onclick="return confirmx('确认要删除该乐购用户优惠券吗？', this.href)">删除</a>
                </td>
            </shiro:hasPermission>--%>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>